package cn.saltice.idempotence.common;

import java.time.LocalDateTime;

/**
 * @program: idempotence
 * @description:
 * @author: Mr.Liu
 * @create: 2020-10-03 21:19
 **/
public class ResposeData {
    public static ResposeData success(Object data){
        return new ResposeData("请求成功",200,data, LocalDateTime.now().toString());
    }
    public static ResposeData error(Object data){
        return new ResposeData("请求失败",510,data, LocalDateTime.now().toString());
    }
    private String message;
    private int code;
    private Object data;
    private String time;

    public ResposeData() {
    }

    public ResposeData(String message, int code, Object data, String time) {
        this.message = message;
        this.code = code;
        this.data = data;
        this.time = time;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }
}
